package com.moon.dto;

import java.util.Objects;

/**
 * @author Chenzy
 * @create 2023-04-01 12:14
 */
public class Item {
    private String nickname;
    private Double price;

    public Item() {
    }

    public Item(String nickname, Double price) {
        this.nickname = nickname;
        this.price = price;
    }

    @Override
    public String toString() {
        return "Item{" +
                "nickname='" + nickname + '\'' +
                ", price='" + price + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Item)) return false;
        Item item = (Item) o;
        return Objects.equals(getNickname(), item.getNickname()) && Objects.equals(getPrice(), item.getPrice());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getNickname(), getPrice());
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }
}
